<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<title>用户注册</title>
</head>
<body>
	<DIV id=div2 style="position: absolute;width: 800px;height: 200px;left: 550px;">
	<h2>用户注册</h2>
	</DIV>
	<DIV id=div1 style="position: absolute;width: 800px;height: 500px;left: 200px;top: 50px;">
	<s:form name="f1" action="client_add" method="post" onsubmit="return check()">
	<table align="center">
		<tr><td>用户名：</td><td><input type="text" name="clientName">
		<font color="red">*</font></td></tr>
		<tr><td>密码：</td><td><input type="password" name="clientPassword">
		<font color="red">*</font></td></tr>
		<tr><td>身份证号码：</td><td><input type="text" name="clientIDcard">
		<font color="red">*</font></td></tr>
		<tr><td>出生日期：</td><td><input type="date" name="clientAge">
		<font color="red">*</font></td></tr>
		<tr><td>性别：</td><td>
		<input type="radio" name="clientSex" value="1" />男
    	<input type="radio" name="clientSex" value="0" checked="checked" />女
		<font color="red">*</font></td></tr>
		<tr><td>电话号码：</td><td><input type="text" name="clientPhoneNum">
		<font color="red">*</font></td></tr>
		<tr><td>地址：</td><td><textarea cols="20" rows="10" name="clientAddress"></textarea>
		<font color="red">*</font></td></tr>
		<tr><td><input type="submit" value="提交" class="btn btn-info"/></td>
		</tr>
		</table>
	</s:form>
	</DIV>
	<script type="text/javascript">
   function check(){
		var clientName = document.f1.clientName;
		var clientPassword = document.f1.clientPassword;
		var clientIDcard = document.f1.clientIDcard;
		var clientAge = document.f1.clientAge;
		var clientSex = document.f1.clientSex;
		var clientPhoneNum = document.f1.clientPhoneNum;
		var clientAddress = document.f1.endTime;
		var reNum =/^[0-9]+$/;
		if(clientName.value==""||clientPassword.value==""||clientIDcard.value==""||clientAge.value==""
		||clientSex.value==""||clientPhoneNum.value==""||clientAddress.value==""){
			alert("必填项不能为空！");
			return false;
		}
		if(!reNum.test(clientPhoneNum.value)){
			alert("“年龄 与 电话号码 必须为数字！");
			return false;
		}
		
		else{
			return true;
		}
	}
    </script>
</body>
</html>